/**
 * <strong>Title : ProductionPerformance.java<br>
 * </strong> <strong>Package : cn.b.sky.mes.em.controller<br>
 * </strong> <strong>Description : </strong>@类注释说明写在此处@<br>
 * <strong>Create on : 2015年11月20日 下午1:47:30<br>
 * </strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 *          <strong>修改历史:</strong><br>
 *          修改人 | 修改日期 | 修改描述<br>
 *          -------------------------------------------<br>
 * <br>
 * <br>
 */
package cn.b.sky.mes.em.controller;

import java.util.List;

import javax.annotation.Resource;

import cn.b.sky.mes.em.model.condition.ProductionPerformanceCondition;
import cn.b.sky.mes.em.service.ProductionPerformanceService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.b.sky.mes.em.model.ProductionPerformance;
import cn.b.sky.user.controller.SecurityController;

/**
 * <strong>Title : ProductionPerformance.java<br></strong>
 * <strong>Package : cn.b.sky.mes.em.controller<br></strong>
 * <strong>Description : </strong>设备生产实绩<br> 
 * <strong>Create on : 2015年11月20日 下午1:47:30<br></strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人 | 修改日期 | 修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
@Controller
@RequestMapping(value = "equipmentProPerformance")
public class ProductionPerformanceController extends SecurityController {
  @Resource
  ProductionPerformanceService productionPerformanceService;

  @RequestMapping("equipmentProPerformance_list")
  public String selecEequipmentProPerformanceList(String navTabId, Model model,
      @ModelAttribute("condition") ProductionPerformanceCondition condition) {
    condition.setSiteCode(getSiteCode());
    List<ProductionPerformance> list = productionPerformanceService
        .selectProductionPerformanceListByCondition(condition);
    int count = productionPerformanceService.selectProductionPerformanceCountByCondition(condition);
    condition.setData(list);
    condition.setTotalCount(count);

    model.addAttribute("page", condition);
    model.addAttribute(NAVTABID, navTabId);
    return "em/productionPerformance/productionPerformance_list";
  }

}
